Skip to content

feat(mcp): append server instructions to context#32490

Merged
rekram1-node merged 11 commits into
anomalyco:devfrom
Arcadi4:feat/mcp-instructions
Jun 24, 2026
Merged

feat(mcp): append server instructions to context#32490
rekram1-node merged 11 commits into
anomalyco:devfrom
Arcadi4:feat/mcp-instructions

Conversation

@Arcadi4

@Arcadi4 Arcadi4 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Refs #28567

Close #30084 #7373

Part of the larger MCP revision.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Append MCP server InitializeResult.instructions to the session system prompt.

Each connected server with instructions contributes a block shaped like:

Instructions from: MCP server <server>
These instructions apply to MCP tools whose names start with `<server>_`, and to prompts/resources from this MCP server.

<server_instructions>

Since tool definitions are separate from the system prompt, this form explicitly links the instruction to the specific set of tools provided by that MCP server.

How did you verify your code works?

Verified locally with focused MCP lifecycle coverage and a prompt-loop request check that observes the instruction block in model context.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node rekram1-node merged commit e8e83af into anomalyco:dev Jun 24, 2026
2 checks passed
@Arcadi4 Arcadi4 deleted the feat/mcp-instructions branch June 26, 2026 01:07
BenGu3 pushed a commit to BenGu3/opencode that referenced this pull request Jun 27, 2026
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
josechifflet pushed a commit to josechifflet/opencode that referenced this pull request Jun 27, 2026
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
(cherry picked from commit e8e83af)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: inject MCP server instructions into system prompt

2 participants